package com.example.demo.controller;

import com.example.demo.entity.Account;
import com.example.demo.mapper.AccountMapper2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author baomidou
 * @since 2023-09-24
 */
@Controller
@RequestMapping("/account")
public class AccountController {
    @Autowired
    AccountMapper2 accountMapper;
    @RequestMapping("/add")
    public Integer addAccount(){
        Account account = new Account();
        account.setName("代码插入的");
        account.setPassword("1");
        account.setSex("2");
        account.setAge("66");
        int result = accountMapper.insert(account);
        return result;
    }

}
